package day9;

import java.awt.image.BufferedImage;

public class SelfPlane extends BaseClass{
    int score;
    int bulletNum=0;
    Bullet[] bu;
    public SelfPlane(){
        bf=Main.selfPlane;
        width=bf.getWidth();
        height=bf.getHeight();
        x=150;
        y=400;
        blood=3;
    }
    BufferedImage[] b={Main.selfPlane,Main.selfPlane2};
    int count=0;
    @Override
    public void move() {
        count++;
        if(count%2==0){
            bf=b[0];
        }
        else {
            bf=b[1];
        }
    }
    public void doubleBulletShoot(){
       bulletNum+=20;
    }
    public Bullet[] bulletshoot(){
        if(bulletNum==0){
            bu=new Bullet[1];
            bu[0]=new Bullet(this.getX()+this.width/2,this.getY());
        }
        else {
            bu=new Bullet[2];
            bu[0]=new Bullet(this.getX()+this.width/4,this.getY());
            bu[1]=new Bullet(this.getX()+this.width/4*3,this.getY());
            bulletNum--;
        }
        return bu;
    }
    public int getScore() {
        return score;
    }

    public void setScore(int score) {
        this.score = score;
    }

}
